home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / libs / unpacklib.lha / UnpackLib / Programmers_Docs / UnpackLib_Docs next >
Text File  |  1995-03-29  |  31KB  |  842 lines

  1. ***************************************************************************
  2. *                        UNPACK.LIBRARY V40.55 DOC                        *
  3. *                                                                         *
  4. *                                                                         *
  5. *                             Update 29-03-95                             *
  6. *                                                                         *
  7. *                                                                         *
  8. *                          SAFE HEX INTERNATIONAL                         *
  9. ***************************************************************************
  10.  
  11.  
  12. Welcome  to  the release version of this library. I hope it's a library you
  13. can  use  in your virus killer or whatever you are doing. One of the things
  14. this library can do, is to help a viruskiller programmer to scan files that
  15. are crunched.
  16.  
  17.  
  18.      o  This  library  is  copyrighted  by  SHI  and  may  NOT  be  used in
  19.         commercial programs without a written permission from SHI.
  20.  
  21.      o  SHI  members can of course use this library for free. (But remember
  22.         to get a written permission.
  23.  
  24.      o  All  Shareware programmers can be SHI members, if they full-fill to
  25.         support our anti-virus work. (But remember to send your address and
  26.         program idea to SHI, to get a written permission).
  27.  
  28.  
  29. It's  forbidden  to  reassemble  (reverse engining) in any way this library
  30. code.  All the ideas to the way we unpacks files are copyrighted by SHI. If
  31. you  don't  respect  our  copyright - or, if you use this library without a
  32. written permission, SHI will contact the police to stop you.
  33.  
  34. Please  add  the  "WantedHelp"  (a  list  containing  wanted  crunchers for
  35. update), and remember to credit the author (Thomas Neumann) and SHI in your
  36. program as stated in the following:
  37.  
  38. ---------------------------------------------------------------------------
  39.  
  40. ABOUT SAFE HEX INTERNATIONAL
  41. If you know a virus programmer you can get a reward of $ 1000 for supplying
  42. his  name  and  address.  The fact is that the law punishes data crime very
  43. severely. (5 years in jail in most countries).
  44.  
  45. We  are  an international group with more than 500 members who have started
  46. trying to stop the spread of virus. Let me give you some example:
  47.  
  48.         1. Our motto is: "Safe Hex", who dares do anything else today?".
  49.         2. A virus bank containing more than 1800 Amiga and PC viruses for
  50.            supporting good shareware antivirus programs.
  51.         3. We help people to get money back lost by virus infection.
  52.         4. We write articles about virus problems for about 20 computer
  53.            magazines worldwide.
  54.         5. We release the newest and the best virus killers around from
  55.            about 25 wellknown programmers worldwide.
  56.         6. We have more than 35 PC and Amiga "Virus Centers" worldwide
  57.            where you can get free virus help by phoning our "Hotline", and
  58.            the newest killers translated in your own language at very
  59.            little cost.
  60.  
  61. For more information contact:
  62.  
  63.         SAFE HEX INTERNATIONAL            (Please send 2 "Coupon-Response
  64.         Erik Loevendahl Soerensen         International" and a self addres-
  65.         Snaphanevej 10                    sed envelope, if you want infor-
  66.         DK-4720 Praestoe                  mation about SHI by letter).
  67.         Denmark
  68.         Phone: + 45 55 99 25 12
  69.         Fax  : + 45 55 99 34 98
  70.  
  71. ---------------------------------------------------------------------------
  72.  
  73. ***************************************************************************
  74. *                            Table of contents                            *
  75. ***************************************************************************
  76.  
  77. unpack.library/upAllocCInfo()
  78. unpack.library/upDetermineFile()
  79. unpack.library/upFreeCInfo()
  80. unpack.library/upFreeFile()
  81. unpack.library/upLoadFile()
  82. unpack.library/upNewUnpackNum()
  83. unpack.library/upSendCmd()
  84. unpack.library/upTestHunk()
  85. unpack.library/upUnpack()
  86. unpack.library/upUnpackList()
  87. unpack.library/upUnpackListNext()
  88. unpack.library/upUnuseDrive()
  89. unpack.library/upUseDrive()
  90.  
  91. ---------------------------------------------------------------------------
  92.  
  93. ***************************************************************************
  94. *                    Offsets and functions destiptions                    *
  95. ***************************************************************************
  96.  
  97.  
  98. upAllocCInfo(34.0)                                       upAllocCInfo(34.0)
  99.  
  100.  
  101. NAME
  102.         upAllocCInfo - allocates an info structure.
  103.  
  104. SYNOPSIS
  105.         info = upAllocCInfo ()
  106.          D0        -30
  107.  
  108.         APTR upAllocCInfo(VOID);
  109.  
  110. FUNCTION
  111.         upAllocCInfo() allocates an info structure the library uses when it
  112.         unpacks files. You just have to call this function in the beginning
  113.         of your program and then free it again with FreeCInfo() at the end.
  114.         I  have  made  this  function,  because  in future versions of this
  115.         library,  the  structure  will be bigger. Your program will then be
  116.         compatible for any future versions of this library.
  117.  
  118. INPUTS
  119.         None.
  120.  
  121. OUTPUTS
  122.         info  -  is a pointer to the allocated info structure. If there has
  123.                  occured an error, a zero is returned.
  124.  
  125. STRUCTURE
  126.         This is how the Info Structure is build:
  127.  
  128.         STRUCTURE UnpackInfo,0
  129.         APTR    UI_Filename
  130.         APTR    UI_Path
  131.         APTR    UI_Jump
  132.         APTR    UI_CruncherName
  133.         APTR    UI_DecrunchAdr
  134.         LONG    UI_DecrunchLen
  135.         UWORD   UI_ErrorNum
  136.         UWORD   UI_CrunchNum
  137.         UBYTE   UI_CrunchType
  138.         UBYTE   UI_Flag
  139.         APTR    UI_LoadNamePoi
  140.         LONG    UI_CrunchLen
  141.         APTR    UI_UserData             ;V35+
  142.         APTR    UI_TrackJump            ;V36+
  143.         APTR    UI_TrkErrJump           ;V36+
  144.         LONG    UI_Offset               ;V36+
  145.         UWORD   UI_Track                ;V36+
  146.         APTR    UI_ErrorMsg             ;V37+
  147.         APTR    UI_CrunchAdr            ;V37+
  148.         APTR    UI_LhaPattern           ;V38+
  149.         BOOL8   UI_UseFilenamePointer   ;V39+
  150.  
  151. ; This Is Private, Do NOT Touch
  152.  
  153.         UBYTE   UI_Pad
  154.         LONG    UI_CrunchLenTemp
  155.         LONG    UI_FileHandler
  156.         LONG    UI_Lock
  157.         LONG    UI_OldLock
  158.         APTR    UI_InfoAdr
  159.         APTR    UI_UnpackPoi
  160.         ULONG   UI_Temp
  161.         STRUCT  UI_Data,4*4             ;V35+
  162.         STRUCT  UI_LoadName,128
  163.         STRUCT  UI_ExecuteString,256
  164.         LABEL   UnpackInfo_SIZEOF
  165.  
  166.  
  167.         NOTE:
  168.         -----
  169.  
  170.         The private area is a bad idea to use, because the different fields
  171.         will maybe be moved around in future versions.
  172.  
  173.  
  174.         UI_Filename     is a pointer to the filename you want to scan.
  175.  
  176.         UI_Path         is  a  pointer  to a zero-terminated path where the
  177.                         library have to unpack archive files, such as a LHA
  178.                         archive. Please select a path where you haven't got
  179.                         some  important  data,  because  ALL  files will be
  180.                         deleted in the path if the DELETE flag is on.
  181.  
  182.         UI_Jump         This  is  a  pointer  to your scan routine. If this
  183.                         pointer are zero, no jump will be made.
  184.  
  185.         UI_CruncherName This is a pointer to the crunchers name the file is
  186.                         crunched with. The name are zero-terminated.
  187.  
  188.         UI_DecrunchAdr  This  is  the start address of the decrunched file.
  189.                         Your  scan routine just have to read this field and
  190.                         the UI_DecrunchLen field and scan that memory.
  191.  
  192.         UI_DecrunchLen  This is the length of the decrunched file.
  193.  
  194.         UI_ErrorNum     If  an  error  occur, the error number is stored in
  195.                         this   field.   See  the  unpack.i  file  for  more
  196.                         information.
  197.  
  198.         UI_CrunchNum    Here  is  the cruncher number stored. Each cruncher
  199.                         has  a  number  so  you can find out which cruncher
  200.                         there are used on the file.
  201.  
  202.         UI_CrunchType   Here   is  a  number  that  tells  about  the  file
  203.                         (archive, data or object file). Bit 7 indicate that
  204.                         the file are encrypted.  It  will  be set after the
  205.                         call to DetermineFile() function.
  206.  
  207.         UI_Flag         You  can  select  some different things the library
  208.                         has  to  do  when  it tests the file. See below for
  209.                         more info.
  210.  
  211.         UI_LoadNamePoi  This  is  just  a pointer to the UI_LoadName field.
  212.                         Use  this if you want to use the UI_LoadName field,
  213.                         because the field will be moved in future versions.
  214.  
  215.         UI_LoadName     Here  is  the filename stored, the library is about
  216.                         to decrunch, if the file is an archive.
  217.  
  218.         UI_CrunchLen    This is the length of the crunched file.
  219.  
  220.         UI_UserData     This  value  will be stored in A1 when the Unpack()
  221.                         function jump through the UI_Jump field. (V35+)
  222.  
  223.         UI_TrackJump    This field have the same function as UI_Jump, exept
  224.                         that  the library will only jump through this field
  225.                         when its unpack a track crunched file, such as DMS.
  226.                         The  library  will jump for every track it unpacks.
  227.                         You  have  to  return a return value in D0. You can
  228.                         select  between  these  values: 0 means every thing
  229.                         are   okay,   just   continue  and  -1  means  stop
  230.                         unpacking.  If this field are zero, no jump will be
  231.                         made (V36+).
  232.  
  233.         UI_TrkErrJump   The  library  will  jump through this pointer if an
  234.                         error  occurs.  There  are a lot of errors, such as
  235.                         checksum  error  etc.  You  routine  can  read  the
  236.                         UI_ErrorNum field in the info structure to see what
  237.                         went  wrong.  In  D0  you  have  to return the same
  238.                         values as in UI_TrackJump (V36+).
  239.  
  240.         UI_Offset       Here  will  be  stored the offset on a disk, ex. if
  241.                         the library just have unpacked track 40, there will
  242.                         be  stored  in this field: 40*22*512. You tracksave
  243.                         routine can read this field, UI_DecrunchAdr and the
  244.                         UI_DecrunchLen  fields  and just call the SendCmd()
  245.                         function with these values as parameters (V36+).
  246.  
  247.         UI_Track        Here  are  stored  the  track the library just have
  248.                         unpacked (V36+).
  249.  
  250.         UI_ErrorMsg     If  an error occurs, a pointer to the error message
  251.                         will be stored here (V37+).
  252.  
  253.         UI_CrunchAdr    This  is a pointer to the crunched data. If you use
  254.                         the  NoLoad  flag,  you  have  to  store  the start
  255.                         address and the length of the crunched data in this
  256.                         field and the UI_CrunchLen field (V37+).
  257.  
  258.         UI_LhaPattern   Here can you store a pointer to a Lha pattern. This
  259.                         means,  the  zero-terminated  string  this  pointer
  260.                         points to, will be copied at the end of the execute
  261.                         string. If you ex. have a string containing: "a#?",
  262.                         the  unpack.library  will  only  unpack  all  files
  263.                         starting with an "a". Zero in this pointer means no
  264.                         pattern (V38+).
  265.  
  266.                         NOTE:  This pointer will be ignored if you have set
  267.                         the UFB_OneFile bit in the UI_Flag.
  268.  
  269.         UI_UseFilenamePointer
  270.                         This  boolean  flag  will  be set to true, when you
  271.                         must    use    the   filename   pointed   to   with
  272.                         UI_LoadNamePoi.  If  false, you have to use you own
  273.                         filename.  This  flag  will  be  set  to  true when
  274.                         unpacking a file in an archive and the file type is
  275.                         not an archive. See example (V39+).
  276.  
  277.  
  278. The flag have the following functions:
  279.  
  280.  
  281. Name         Bit             Function
  282. ---------------------------------------------------------------------------
  283. UFB_OneFile  0          Select  to  unpack  one file at a time or the whole
  284.                         archive. If set, one file is selected.
  285.  
  286. UFB_Delete   1          Delete  files  after scanning. Set = Delete. If you
  287.                         set  this bit on, ALL files AND directories will be
  288.                         deleted,  not  only  the files there were stored in
  289.                         the archive.
  290.  
  291. UFB_NoFree   2          If this bit is set, the decrunched file will NOT be
  292.                         freed  from memory after the Unpack() function have
  293.                         called through the UI_Jump pointer. If you set this
  294.                         bit,  you  have to free the memory by yourself with
  295.                         the FreeFile() function. (V35+)
  296.  
  297. UFB_Banner   3          This  bit are the give banner bit. If set, you will
  298.                         get the banner text in UI_DecrunchAdr. Your routine
  299.                         the  UI_TrackJump  pointer  points to, have to test
  300.                         the  UI_Offset field to see it's a banner or normal
  301.                         track there are given. If the UI_Offset are -1, its
  302.                         a banner. (V36+)
  303.  
  304. UFB_NoLoad   4          If  this  bit  are  set,  the  DetermineFile()  and
  305.                         Unpack()  functions  will  not  load  the file into
  306.                         memory,  but  use the UI_CrunchAdr and UI_CrunchLen
  307.                         field  in  the  Unpack  Info  structure  to get the
  308.                         crunched data (V37+).
  309.  
  310. UFB_Protect  5          If you set this bit and the UFB_NoLoad are cleared,
  311.                         the   DetermineFile()   function  will  change  the
  312.                         protections  bit  on the file to determine. It will
  313.                         set the RWED bits (V38+).
  314.  
  315.              6-7        Reserved
  316.  
  317. BUGS
  318.         None known.
  319.  
  320. SEE ALSO
  321.         upFreeCInfo()
  322.  
  323. ---------------------------------------------------------------------------
  324.  
  325. upDetermineFile(34.0)                                 upDetermineFile(34.0)
  326.  
  327.  
  328. NAME
  329.         upDetermineFile - scans a file  to find out which cruncher that are
  330.                           used.
  331.  
  332. SYNOPSIS
  333.         success = upDetermineFile (info, filename)
  334.           D0           -42          A0      A1
  335.  
  336.         BOOL upDetermineFile (APTR, char *);
  337.  
  338. FUNCTION
  339.         upDetermineFile()  scans a file to find out which cruncher the file
  340.         are  crunched with. If the library can't find out, an error message
  341.         is  returned.  You  have  to  call  this  function  first, then the
  342.         upUnpack() function, if no error has occured.
  343.  
  344. INPUTS
  345.         info     - is  the  memory  address you got from the upAllocCInfo()
  346.                    function.
  347.  
  348.         filename - is  a  pointer  to  the  filename  you want to scan. The
  349.                    filename has to be zero-terminated.
  350.  
  351. OUTPUTS
  352.         success  - is an indicator that tells about the operation. If every
  353.                    thing is okay, a non-zero value is returned, else a zero
  354.                    will  be  returned. If you get an error, you can look at
  355.                    the  UI_ErrorNum  flag in the info structure to see what
  356.                    went wrong.
  357.  
  358. BUGS
  359.         None known.
  360.  
  361. SEE ALSO
  362.         upUnpack()
  363.  
  364. ---------------------------------------------------------------------------
  365.  
  366. upFreeCInfo(34.0)                                         upFreeCInfo(34.0)
  367.  
  368.  
  369. NAME
  370.         upFreeCInfo - frees the info structure again.
  371.  
  372. SYNOPSIS
  373.         upFreeCInfo (info)
  374.             -36       A0
  375.  
  376.         void upFreeCInfo (APTR);
  377.  
  378. FUNCTION
  379.         upFreeCInfo() frees the info structure again. You have to call this
  380.         function at the end of your program.
  381.  
  382. INPUTS
  383.         info  - is  the  memory  address  you  got  from the upAllocCInfo()
  384.                 function.  If the memory address is zero, you will NOT take
  385.                 a  trip  to  India  (and visit the GURU) when you call this
  386.                 function.
  387.  
  388. OUTPUTS
  389.         None.
  390.  
  391. BUGS
  392.         None known.
  393.  
  394. SEE ALSO
  395.         upAllocCInfo()
  396.  
  397. ---------------------------------------------------------------------------
  398.  
  399. upFreeFile(34.20)                                         upFreeFile(34.20)
  400.  
  401.  
  402. NAME
  403.         upFreeFile - frees a file from memory.
  404.  
  405. SYNOPSIS
  406.         upFreeFile (info)
  407.            -84       A0
  408.  
  409.         void upFreeFile (APTR);
  410.  
  411. FUNCTION
  412.         You   have  to  call  this  function  after  you  have  called  the
  413.         upLoadFile() function and are finished with the file. This function
  414.         frees the memory again.
  415.  
  416.         NOTE:  You MUST call this function instead of freeing the memory by
  417.         yourself!!
  418.  
  419. INPUTS
  420.         info - is   the  memory  address  you  got  from the upAllocCInfo()
  421.                function.  You  can  call  always this function, even if the
  422.                upLoadFile() function returned an error.
  423.  
  424. OUTPUTS
  425.         None.
  426.  
  427. BUGS
  428.         None known.
  429.  
  430. SEE ALSO
  431.         upLoadFile()
  432.  
  433. ---------------------------------------------------------------------------
  434.  
  435. upLoadFile(34.20)                                         upLoadFile(34.20)
  436.  
  437.  
  438. NAME
  439.         upLoadFile - loads a file into memory.
  440.  
  441. SYNOPSIS
  442.         success = upLoadFile (info)
  443.           D0         -78       A0
  444.  
  445.         BOOL upLoadFile (APTR);
  446.  
  447. FUNCTION
  448.         This  function allocate some memory with the files length and loads
  449.         the file into it. The filename are taken from the UI_Filename field
  450.         in  the  info  structure.  The  length  and address of the file are
  451.         stored in UI_DecrunchLen and UI_DecrunchAdr.
  452.  
  453.         V36.30:
  454.         -------
  455.         If  the library runs under KS 37+, all caches will be cleared after
  456.         the file are loaded into the memory.
  457.  
  458. INPUTS
  459.         info    - is  the  memory  address  you got from the upAllocCInfo()
  460.                   function.
  461.  
  462. OUTPUTS
  463.         success - is  an indicator that tells about the operation. If every
  464.                   thing  is  okay, the file length is returned, else a zero
  465.                   will  be returned and the allocated memory will be freed.
  466.                   If you get an error, you can look at the UI_ErrorNum flag
  467.                   in the info structure to see what went wrong.
  468.  
  469. BUGS
  470.         None known.
  471.  
  472. SEE ALSO
  473.         upFreeFile()
  474.  
  475. ---------------------------------------------------------------------------
  476.  
  477. upNewUnpackNum(37.32)                                 upNewUnpackNum(37.32)
  478.  
  479.  
  480. NAME
  481.         upNewUnpackNum - gives the number of unpackers in a structure.
  482.  
  483. SYNOPSIS
  484.         number = upNewUnpackNum ()
  485.           A0         -108
  486.  
  487.         APTR upNewUnpackNum (void);
  488.  
  489. FUNCTION
  490.         upNewUnpackNum()  counts  the  number  of unpackers the library can
  491.         determine  and  unpack.  You  will  get  two  different  numbers of
  492.         unpackers. The first one (types) are the numbers of different types
  493.         the  library  can  unpack,  example  PowerPacker  Data, PowerPacker
  494.         Library etc. The second one (unpackers) is the number of unpackers,
  495.         example PowerPacker, Lha, Imploder etc.
  496.  
  497. INPUTS
  498.         None.
  499.  
  500. OUTPUTS
  501.         number - a pointer to a structure that look like this:
  502.  
  503.                 STRUCTURE NumberStruct,0
  504.                 UWORD   NS_Version      ;Library Version
  505.                 UWORD   NS_Revision     ;Library Revision
  506.                 UWORD   NS_Types
  507.                 UWORD   NS_Unpackers
  508.                 LABEL   NumberStruct_SIZEOF
  509.  
  510. BUGS
  511.         None known.
  512.  
  513. ---------------------------------------------------------------------------
  514.  
  515. upSendCmd(36.30)                                           upSendCmd(36.30)
  516.  
  517.  
  518. NAME
  519.         upSendCmd - sends a command to a devive.
  520.  
  521. SYNOPSIS
  522.         error = upSendCmd (dinfo, address, offset, length, cmd)
  523.          D0       -102      A0      A1       D1      D2    D0
  524.  
  525.         UBYTE upSendCmd (APTR, APTR, ULONG, ULONG, UBYTE);
  526.  
  527. FUNCTION
  528.         The  only  thing  this  function does, is send the command with the
  529.         parameters  to  the device opened by the upUseDrive() function. The
  530.         command will be sent by the DoIO() function.
  531.  
  532. INPUTS
  533.         dinfo   - is a pointer returned by the upUseDrive() function.
  534.  
  535.         address - is a pointer to the data area.
  536.  
  537.         offset  - is the offset on the disk.
  538.  
  539.         length  - is the number of bytes to send.
  540.  
  541.         cmd     - is the command to send, like a read, write or update.
  542.  
  543. OUTPUTS
  544.         error   - is the error number returned by the device.
  545.  
  546. BUGS
  547.         None known.
  548.  
  549. SEE ALSO
  550.         upUseDrive(), upUnuseDrive()
  551.  
  552. ---------------------------------------------------------------------------
  553.  
  554. upTestHunk(34.1)                                           upTestHunk(34.1)
  555.  
  556.  
  557. NAME
  558.         upTestHunk - tests the hunk structure in a file.
  559.  
  560. SYNOPSIS
  561.         success = upTestHunk (address)
  562.           D0         -54        A0
  563.  
  564.         BOOL upTestHunk (APTR);
  565.  
  566. FUNCTION
  567.         upTestHunk()  tests  a  file for the hunk structure. You have to be
  568.         sure,  that  the file you want to test is an object file, else this
  569.         routine  will  return  an  error. You can check this by look in the
  570.         UI_CrunchType  flag  in  the info structure. You don't need to call
  571.         this  function  by  yourself  before  you  calling  the  upUnpack()
  572.         function,  because the upUnpack() function does that by itself. I'm
  573.         not quite sure it handles the overlay hunk correctly, but it should
  574.         handle  it.  If you find a file you know are okay and this function
  575.         says it's defect, please send me the file so I can find the error.
  576.  
  577. INPUTS
  578.         address - is the start address of the file you want to test.
  579.  
  580. OUTPUTS
  581.         success - is  an indicator that tells about the operation. If every
  582.                   thing  is okay, a non-zero value is returned, else a zero
  583.                   will be returned.
  584.  
  585. BUGS
  586.         None known.
  587.  
  588. ---------------------------------------------------------------------------
  589.  
  590. upUnpack(34.0)                                               upUnpack(34.0)
  591.  
  592.  
  593. NAME
  594.         upUnpack - unpacks the file.
  595.  
  596. SYNOPSIS
  597.         success = upUnpack (info)
  598.           D0        -48      A0
  599.  
  600.         BOOL upUnpack (APTR);
  601.  
  602. FUNCTION
  603.         upUnpack() loads the file into memory and unpacks it. When the file
  604.         is  unpacked,  the library will jump through the UI_Jump pointer to
  605.         your scan routine. If the UI_Jump contains a zero, the library will
  606.         not  jump.  All  what  your  scan  routine has to do, is to get the
  607.         UI_DecrunchAdr  and UI_DecrunchLen from the info structure and scan
  608.         that memory. If the file is an archive (Lha, zoo), the library will
  609.         unpack  the  archive  and  then read one file at a time and jump to
  610.         your scan routine.
  611.         If  you  need  a password to unpack a file, the library will open a
  612.         little  window  where  it asks for the password. The window will be
  613.         opened  on  the active screen, so if you open a screen by yourself,
  614.         the window will appear on it (if it's active).
  615.  
  616.         NOTE:
  617.         -----
  618.         After  an  archive  is  unpacked  and  scanned,  all  the files and
  619.         directories  in  the  path you have selected will be deleted if the
  620.         DELETE  flag  is  on,  not  just the files there were stored in the
  621.         archive,  but  ALL  files will be deleted, so be sure to use a temp
  622.         directory or something like that.
  623.  
  624.         V35.22:
  625.         -------
  626.         When this function jumps through the UI_Jump pointer, the following
  627.         registers will have these pointers:
  628.  
  629.         A0 = The start address of your routine (Unpack() makes a jsr (a0)).
  630.         A1 = Your pointer stored in the UI_UserData field.
  631.         A4 = The start address of the info structure.
  632.  
  633.         V36.30:
  634.         -------
  635.         If the library runs under KS V37+, all caches will be cleared after
  636.         the decrunching.
  637.  
  638.         Track Crunched Files:
  639.         ---------------------
  640.         This  function  will  jump  through UI_TrackJump instead of UI_Jump
  641.         when  it  unpacks  a  track crunched file. Such files are ex. a DMS
  642.         file.  The  routine have to return a value in D0. The values can be
  643.         0 to indicate that every things are ok and -1 to stop unpacking.
  644.  
  645.         V38.40:
  646.         -------
  647.         This  function  are  now  made  recursive.  That means it will call
  648.         itself  until  the  file  can't  be decrunched any more. Now it can
  649.         unpack  a  lha  file in a lha file or a file crunched with imploder
  650.         and  powerpacker  etc.  If you have ex. select to unpack a lha file
  651.         at  RAM:,  the  first lha file will be unpacked there. If there are
  652.         more  lha  files,  the next one will be unpacked in RAM:-xxx/ where
  653.         xxx is the name of the lha archive etc.
  654.  
  655.         NOTE:
  656.         -----
  657.         The  recursive  process  will  take a lot of stack and memory. Each
  658.         time  the  function  will  call itself, it will allocate a new info
  659.         structure and 256 bytes to the new path.
  660.  
  661. INPUTS
  662.         info     - is  the  memory  address you got from the upAllocCInfo()
  663.                    function.
  664.  
  665. OUTPUTS
  666.         success  - is an indicator that tells about the operation. If every
  667.                    thing is okay, a non-zero value is returned, else a zero
  668.                    will  be  returned. If you get an error, you can look at
  669.                    the  UI_ErrorNum  flag in the info structure to see what
  670.                    went wrong.
  671.  
  672. BUGS
  673.         The  DMS Deep decruncher will not work correctly. I try to fix this
  674.         bug as soon as possible.
  675.  
  676. SEE ALSO
  677.         upDetermineFile(), upAllocCInfo()
  678.  
  679. ---------------------------------------------------------------------------
  680.  
  681. upUnpackList(34.1)                                       upUnpackList(34.1)
  682.  
  683.  
  684. NAME
  685.         upUnpackList - makes an unpacker name list.
  686.  
  687. SYNOPSIS
  688.         name = upUnpackList (info)
  689.          A1        -66        A0
  690.  
  691.         char * upUnpackList (APTR);
  692.  
  693. FUNCTION
  694.         upUnpackList()  gives  a  pointer to the first name to a packer the
  695.         library  can  determine & unpack. You can use this function, if you
  696.         want  to  make  a  list  over  all  the  unpackers  the library can
  697.         determine.    Call    this    function    first    and   then   use
  698.         upUnpackListNext().
  699.  
  700. INPUTS
  701.         info - is   the  memory  address  you  got  from the upAllocCInfo()
  702.                function.
  703.  
  704. OUTPUTS
  705.         name - is  a  pointer  to  a null-terminated string where the first
  706.                name are stored.
  707.  
  708. BUGS
  709.         None known.
  710.  
  711. SEE ALSO
  712.         upUnpackListNext()
  713.  
  714. ---------------------------------------------------------------------------
  715.  
  716. upUnpackListNext(34.1)                               upUnpackListNext(34.1)
  717.  
  718.  
  719. NAME
  720.         upUnpackListNext - reads the next name in the unpacker list.
  721.  
  722. SYNOPSIS
  723.         success,name = upUnpackListNext (info)
  724.           D0     A1          -72          A0
  725.  
  726.         BOOL,APTR upUnpackListNext (APTR);
  727.  
  728. FUNCTION
  729.         upUnpackListNext() gives a pointer to the next name to a packer the
  730.         library  can  determine & unpack. You can use this function, if you
  731.         want  to  make  a  list  over  all  the  unpackers  the library can
  732.         determine. Call the upUnpackList() function first and then use this
  733.         function.
  734.  
  735. INPUTS
  736.         info    - is  the  memory  address  you got from the upAllocCInfo()
  737.                   function.
  738.  
  739. OUTPUTS
  740.         name    - is  a  pointer to a null-terminated string where the next
  741.                   name are stored.
  742.  
  743.                   V37.32
  744.                   ------
  745.                   This  pointer will also be zero when the success flag are
  746.                   zero. This are only made for C-programmers.
  747.  
  748.         success - if  this  contains a zero, there are no more crunchers in
  749.                   the list. Otherwise it will contain a non-zero value.
  750.  
  751. BUGS
  752.         None known.
  753.  
  754. SEE ALSO
  755.         upUnpackList()
  756.  
  757. ---------------------------------------------------------------------------
  758.  
  759. upUnuseDrive(36.30)                                     upUnuseDrive(36.30)
  760.  
  761.  
  762. NAME
  763.         upUnuseDrive - give back the drive to DOS.
  764.  
  765. SYNOPSIS
  766.         upUnuseDrive (dinfo)
  767.             -96        A0
  768.  
  769.         void upUnuseDrive (APTR);
  770.  
  771. FUNCTION
  772.         This function closes the device again and make the drive unbusy.
  773.  
  774. INPUTS
  775.         dinfo - is the pointer returned by the upUseDrive() function.
  776.  
  777. OUTPUTS
  778.         Nothing.
  779.  
  780. BUGS
  781.         None known.
  782.  
  783. SEE ALSO
  784.         upUseDrive(), upSendCmd()
  785.  
  786. ---------------------------------------------------------------------------
  787.  
  788. upUseDrive(36.30)                                         upUseDrive(36.30)
  789.  
  790.  
  791. NAME
  792.         upUseDrive - make a drive busy and ready for use.
  793.  
  794. SYNOPSIS
  795.         dinfo = upUseDrive (info, drive)
  796.          D0        -90       A0     A1
  797.  
  798.         APTR upUseDrive (APTR, char *);
  799.  
  800. FUNCTION
  801.         This  function  find out which device the drive given uses and open
  802.         it. Then it will make the drive busy, that means CLI/WorkBench will
  803.         not  be  able  to  use that drive until you unuse it. It's only you
  804.         that  can use it. This function are only made to give you a help to
  805.         write a track crunched-file saver.
  806.  
  807. INPUTS
  808.         info  - is  the  memory  address  you  got  from the upAllocCInfo()
  809.                 function.
  810.  
  811.         drive - is a pointer to the drive you want to use, ex. DF0:, RAD:.
  812.  
  813. OUTPUTS
  814.         dinfo - is  a  pointer  to  a  structure  used  by the device. This
  815.                 structure  includes a IOStdReq structure and a message port
  816.                 structure.  If  you  get  a zero back, an error occurs. You
  817.                 can see in the UI_ErrorNum field to see want went wrong.
  818.  
  819. BUGS
  820.         None known.
  821.  
  822. SEE ALSO
  823.         upUnuseDrive(), upSendCmd()
  824.  
  825. ---------------------------------------------------------------------------
  826.  
  827.         I  really  hope  you  can use this library. See also the Unpack.IFF
  828.         file to see how to construct your program.
  829.  
  830.         If  you  find any bugs in the library or if you have some crunchers
  831.         there  are  not  in  the  library,  please send a bug report or the
  832.         crunchers to me, thanks! See in the "WantedHelp" for more info!
  833.  
  834.  
  835.    WE NEED YOUR HELP TO GET THIS LIBRARY EVEN BETTER, THANK YOU VERY MUCH!
  836.  
  837.  
  838.         Thomas Neumann       Member of the SHI Anti Virus Group.
  839.         Kongensgade 78
  840.         3550 Slangerup
  841.         Denmark
  842.